﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class SiteMaster : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            MenuSelection();
        }
    }
    private void MenuSelection()
    {
        if (Page.ToString() == "ASP.brand_list_aspx" || Page.ToString() == "ASP.category_list_aspx" || Page.ToString() == "ASP.add_subscription_aspx" || Page.ToString() == "ASP.subscription_list_aspx" || Page.ToString() == "ASP.addfilter_detail_aspx" || Page.ToString() == "ASP.filterdetail_list_aspx" || Page.ToString() == "ASP.add_city_aspx" || Page.ToString() == "ASP.city_list_aspx" || Page.ToString() == "ASP.add_state_aspx" || Page.ToString() == "ASP.state_list_aspx" || Page.ToString() == "ASP.add_product_aspx" || Page.ToString() == "ASP.product_list_aspx" || Page.ToString() == "ASP.merchant_list_aspx" || Page.ToString() == "ASP.add_promotioncode_aspx" || Page.ToString() == "ASP.promotioncode_list_aspx" || Page.ToString() == "ASP.inactivemerchantlist_aspx")
        {
            liMaster.Attributes.Add("class", "open");
            ulMaster.Style.Add("display", "block");
            if (Page.ToString() == "ASP.brand_list_aspx" || Page.ToString() == "ASP.category_list_aspx")
            {
                liMainCategorybrand.Attributes.Add("class", "open");
                ulCategoryBrand.Style.Add("display", "block");
                if (Page.ToString() == "ASP.brand_list_aspx")
                    liBrand.Attributes.Add("class", "active");
                if (Page.ToString() == "ASP.category_list_aspx")
                    liCategory.Attributes.Add("class", "active");
            }
            if (Page.ToString() == "ASP.addfilter_detail_aspx" || Page.ToString() == "ASP.filterdetail_list_aspx")
            {
                liMainFilterDetail.Attributes.Add("class", "open");
               // ulFilterDetail.Style.Add("display", "block");
                //if (Page.ToString() == "ASP.addfilter_detail_aspx")
                //    liAddFilterDetail.Attributes.Add("class", "active");

                //if (Page.ToString() == "ASP.filterdetail_list_aspx")
                //    liFilterDetailList.Attributes.Add("class", "active");
            }
            if (Page.ToString() == "ASP.add_subscription_aspx" || Page.ToString() == "ASP.subscription_list_aspx" || Page.ToString() == "ASP.add_promotioncode_aspx" || Page.ToString() == "ASP.promotioncode_list_aspx")
            {
                liMainSubscription.Attributes.Add("class", "open");
                ulSubscription.Style.Add("display", "block");
                if (Page.ToString() == "ASP.add_subscription_aspx")
                    liAddSubscription.Attributes.Add("class", "active");
                if (Page.ToString() == "ASP.subscription_list_aspx")
                    liSubscriptionList.Attributes.Add("class", "active");
                if (Page.ToString() == "ASP.add_promotioncode_aspx")
                    liPromotionCode.Attributes.Add("class", "active");
                if (Page.ToString() == "ASP.promotioncode_list_aspx")
                    liPromotionCodeList.Attributes.Add("class", "active");
            }
            if (Page.ToString() == "ASP.city_list_aspx" || Page.ToString() == "ASP.state_list_aspx")
            {
                liMainState.Attributes.Add("class", "open");
                ulState.Style.Add("display", "block");
                if (Page.ToString() == "ASP.city_list_aspx")
                    liCityList.Attributes.Add("class", "active");
                if (Page.ToString() == "ASP.state_list_aspx")
                    liStateList.Attributes.Add("class", "active");
            }
            //if (Page.ToString() == "ASP.add_city_aspx" || Page.ToString() == "ASP.city_list_aspx")
            //{
            //    liMainCity.Attributes.Add("class", "open");
            //    ulCity.Style.Add("display", "block");
            //    if (Page.ToString() == "ASP.addcity_detail_aspx")
            //        liAddCity.Attributes.Add("class", "active");
            //    if (Page.ToString() == "ASP.city_list_aspx")
            //        liCityList.Attributes.Add("class", "active");
            //}
            if (Page.ToString() == "ASP.add_product_aspx" || Page.ToString() == "ASP.product_list_aspx")
            {
                liMainProduct.Attributes.Add("class", "open");
                ulProduct.Style.Add("display", "block");
                if (Page.ToString() == "ASP.add_product_aspx")
                    liAddProduct.Attributes.Add("class", "active");
                if (Page.ToString() == "ASP.product_list_aspx")
                    liProductList.Attributes.Add("class", "active");
            }
            if (Page.ToString() == "ASP.merchant_list_aspx" || Page.ToString() == "ASP.inactivemerchantlist_aspx")
            {
                liMainMerchant.Attributes.Add("class", "open");
                ulMerchant.Style.Add("display", "block");
                if (Page.ToString() == "ASP.merchant_list_aspx")
                    liMerchantList.Attributes.Add("class", "active");
                if (Page.ToString() == "ASP.inactivemerchantlist_aspx")
                liInActiveMerchant.Attributes.Add("class","active");

            }
            //if (Page.ToString() == "ASP.add_promotioncode_aspx" || Page.ToString() == "ASP.promotioncode_list_aspx")
            //{
            //    liMainPromotionCode.Attributes.Add("class", "open");
            //    ulPromotionCode.Style.Add("display", "block");
              

            //}
        }
    }
}
